﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.PackageManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.PackageManagement.PackageParaVMs
{
    public partial class PackageParaTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._PackagePara._ValueName")]
        public ExcelPropety ValueName_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.ValueName);
        [Display(Name = "_Model._PackagePara._ValueMode")]
        public ExcelPropety ValueMode_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.ValueMode);
        [Display(Name = "_Model._PackagePara._Value")]
        public ExcelPropety Value_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.Value);
        [Display(Name = "_Model._PackagePara._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.Remark);
        [Display(Name = "_Model._PackagePara._Scheme")]
        public ExcelPropety Scheme_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.SchemeId);
        [Display(Name = "_Model._PackagePara._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.CreateTime, true);
        [Display(Name = "_Model._PackagePara._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.UpdateTime, true);
        [Display(Name = "_Model._PackagePara._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.CreateBy);
        [Display(Name = "_Model._PackagePara._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.UpdateBy);
        [Display(Name = "_Model._PackagePara._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.IsValid);
        [Display(Name = "_Model._PackagePara._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<PackagePara>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Scheme_Excel.DataType = ColumnDataType.ComboBox;
            Scheme_Excel.ListItems = DC.Set<PackageScheme>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class PackageParaImportVM : BaseImportVM<PackageParaTemplateVM, PackagePara>
    {
            //import

    }

}